package guijavacommander.actions;

import guijavacommander.JavaCommander;
import guijavacommander.FilePanel;
import guijavacommander.lister.ListerFrame;

import javax.swing.*;
import java.awt.event.ActionEvent;
import java.io.File;

/**
 * User: Deady
 * Date: 20.07.2009
 * Time: 10:35:44
 */
public class ViewFileAction extends AbstractAction {


    public void actionPerformed(ActionEvent e) {
        JavaCommander cmd = JavaCommander.instance;
        FilePanel active = cmd.getActivePanel();

        File f = active.getCurrentFile();
        if (f.isFile()) {
            ListerFrame lister = new ListerFrame();
            lister.setSource(f);
            lister.setVisible(true);
        }
    }


}
